<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
	<title>업체연락망</title>
	<link rel="stylesheet" type="text/css" href="/mongo/resources/inc/css/common.css">
	<script type="text/javascript" src="/mongo/resources/inc/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript">
	<!--
		var dataJSON = {};
		
		$(document).ready( function(){
			initialize();
			
			$(".call").click(function() {
				
				if($(this).attr("callNum") == "" || $(this).attr("callNum") == null){
					return;
				}
				var callNum = ""; 
							
				callNum = $(this).attr("callNum").split("-").join("");
				callNum = callNum.split(" ").join("");
				callNum = callNum.split("(").join("");
				callNum = callNum.split(")").join("");
				
				var sendUrl = ""; 
					
				sendUrl = "http://cti.refine.co.kr/t-motion/contents/statistics/callback/tmotion_senddialpacket.php?Customer_Num=" 
							+ callNum + "&Ext=${extNo}&ctrlNo=IT&userId=${login.userId}&kind=IT"  ;
				
				window.open(sendUrl , "clickToCall", "width=450, height=200");
		 	});
		});
		
		function initialize(){
			$("#contactList").empty();
			<c:forEach var="datas" items="${contacts}">
				$("#contactList").append(displayList(${datas}));
			</c:forEach>
		}
		
		function displayList(datas) {
			r =
				"<tr>"
				+ "	<td>" + datas.company + "</td>"
				+ "	<td>" + datas.work + "</td>"
				+ "	<td>" + datas.name + "</td>"
				+ "	<td>" + datas.position + "</td>"
				+ "	<td class='hand call' callNum='"+datas.tel+"'>" + datas.tel + "</td>"
				+ "	<td class='hand call' callNum='"+datas.mobile+"'>" + datas.mobile + "</td>"
				+ "	<td>" + datas.email + "</td>"
				+ "	<td>" + datas.etc + "</td>"
				+ "</tr>";
				
			return r;
		}
	-->
	</script>
</head>
<body>
<P>  The time on the server is ${serverTime}. </P>

<table class="tbl-list" summary="연락처리스트">
	<caption>업체연락망</caption>
	<colgroup>
		<col width="100" />
		<col width="100" />
		<col width="100" />
		<col width="100" />
		<col width="150" />
		<col width="150" />
		<col width="200" />
		<col width="" />
	</colgroup>
	<thead>
		<tr>
			<th scope="col">회사</th>
			<th scope="col">담당업무</th>
			<th scope="col">이름</th>
			<th scope="col">직급</th>
			<th scope="col">연락처</th>
			<th scope="col">휴대폰</th>
			<th scope="col">E-mail</th>
			<th scope="col">비고</th>
		</tr>
	</thead>
	<tbody id="contactList">
	</tbody>
</table>	
</body>
</html>
